package com.iplant.pdm.service.po.mss;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;

/**
 * 工序BOM
 *
 * @author YouWang·Peng
 * 2023-7-27 09:40:44
 */
@DBBasePO(TableName = "mss_bomitem", CheckName = {"Code", "RouteID,RoutePartID,RoutePartPointID,MaterialID," +
        "ReplaceType,OutsourceType"},
        CodeAuto = true, CodePrefix = "RMI-", CodeNum = 4, Schemas = DBSchemas.PDM)
public class MSSBOMItem extends BasePO implements Serializable {

    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    @DBCondition
    @DBField
    public int RouteID = 0;//工艺路线ID
    @DBJoin(name = "Code", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteCode = "";//工艺路线编码
    @DBJoin(name = "Version", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteVersion = "";//工艺路线版本

    @DBCondition
    @DBField
    public int RoutePartID = 0; // 工艺集ID
    @DBJoin(name = "Name", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartName = ""; // 工艺集名称
    @DBJoin(name = "Code", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartCode = ""; // 工艺集编码
    @DBJoin(name = "OrderID", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public int RoutePartOrder = 0;

    @DBCondition
    @DBField
    public int RoutePartPointID = 0; // 工艺工序ID
    @DBJoin(name = "Name", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointName = ""; // 工艺工序名称
    @DBJoin(name = "Code", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointCode = ""; // 工艺工序编码

    @DBJoin(name = "OrderID", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas =
            DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public int RoutePartPointOrder = 0;

    /**
     * 物料ID
     */
    @DBCondition
    @DBField(CheckValue = true)
    public int MaterialID = 0;
    /**
     * 物料编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            JoinMode = DBJoin.DBJoinMode.Inner, MainTableField = "MaterialID")
    public String MaterialNo = "";
    /**
     * 物料名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            JoinMode = DBJoin.DBJoinMode.Inner, MainTableField = "MaterialID")
    public String MaterialName = "";

    /**
     * 规格型号
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Groes", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            JoinMode = DBJoin.DBJoinMode.Inner, MainTableField = "MaterialID")
    public String Groes = "";

    /**
     * 物料数量
     */
    @DBField
    public Double MaterialNumber = 0.0;

    /**
     * 物料预留区别ID
     */
    @DBCondition
    @DBField
    public int TypeID = 0;

    /**
     * 物料类型ID
     */
    @DBJoin(name = "MaterialTypeID", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public int MaterialTypeID = 0;
    /**
     * 物料类型编码
     */
    @DBJoin(name = "Code", tableName = "mss_materialtype", tableAsName = "materialtype1", Schemas = DBSchemas.Basic,
            JoinIndex = 2,
            ConditionalJoin = "material1.MaterialTypeID=materialtype1.ID")
    public String MaterialTypeCode = "";
    /**
     * 物料类型名称
     */
    @DBJoin(name = "Name", tableName = "mss_materialtype", tableAsName = "materialtype1", Schemas = DBSchemas.Basic,
            JoinIndex = 2,
            ConditionalJoin = "material1.MaterialTypeID=materialtype1.ID")
    public String MaterialTypeName = "";

    /**
     * 物料组
     */
    @DBJoin(name = "MaterialGroupID", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public int MaterialGroupID = 0;

    /**
     * 物料组编号
     */
    @DBJoin(name = "Code", tableName = "mss_materialgroup", tableAsName = "materialgroup1", Schemas = DBSchemas.Basic,
            JoinIndex = 3, JoinMode = DBJoin.DBJoinMode.Inner,
            ConditionalJoin = "material1.MaterialGroupID=materialgroup1.ID")
    public String MaterialGroupCode = "";
    /**
     * 物料组名称
     */
    @DBJoin(name = "Name", tableName = "mss_materialgroup", tableAsName = "materialgroup1", Schemas = DBSchemas.Basic,
            JoinIndex = 3, JoinMode = DBJoin.DBJoinMode.Inner,
            ConditionalJoin = "material1.MaterialGroupID=materialgroup1.ID")
    public String MaterialGroupName = "";

    /**
     * 物料组名称
     */


    @DBCondition(CompareType = DBCondition.DBCompareType.leftLike)
    @DBJoin(name = "FullGroupName", tableName = "mss_materialgroup", tableAsName = "materialgroup1", Schemas =
            DBSchemas.Basic,
            JoinIndex = 3, JoinMode = DBJoin.DBJoinMode.Inner,
            ConditionalJoin = "material1.MaterialGroupID=materialgroup1.ID")
    public String MaterialFullGroup = "";

    @DBField
    public int GradeID = 0;

    @DBJoin(name = "CYUnitID", tableName = "mss_material", tableAsName = "material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public int UnitID = 0;
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "unit1", Schemas = DBSchemas.Basic,
            JoinIndex = 4,
            ConditionalJoin = "material1.CYUnitID=unit1.ID")
    public String UnitText = "";

    @DBJoin(name = "Code", tableName = "mss_unit", tableAsName = "unit1", Schemas = DBSchemas.Basic,
            JoinIndex = 4,
            ConditionalJoin = "material1.CYUnitID=unit1.ID")
    public String UnitCode = "";

    /**
     * 必换1/偶换2
     */
    @DBField
    public int ReplaceType = 0;
    /**
     * 偶换率
     */
    @DBField
    public float ReplaceRatio = 0.0f;
    /**
     * 委外必修件1/委外偶修件2/自修必修3/自修偶修4/ 其他0
     */
    @DBField
    public int OutsourceType = 0;
    /**
     * 原拆原装要求 X/空
     */
    @DBField
    public int OriginalType = 0;
    /**
     * 评估类型
     */
    @DBField
    public int DisassyType = 0;

    /**
     * 是否扫码
     */
    @DBCondition
    @DBField
    public int IsCodeScanning = 0;

    /**
     * 是否检验
     */
    @DBCondition
    @DBField
    public int IsCheck = 0;

    @JsonProperty("RouteID")
    public int getRouteID() {
        return RouteID;
    }

    public void setRouteID(int routeID) {
        RouteID = routeID;
    }

    @JsonProperty("RouteCode")
    public String getRouteCode() {
        return RouteCode;
    }

    public void setRouteCode(String routeCode) {
        RouteCode = routeCode;
    }

    @JsonProperty("RouteVersion")
    public String getRouteVersion() {
        return RouteVersion;
    }

    public void setRouteVersion(String routeVersion) {
        RouteVersion = routeVersion;
    }

    @JsonProperty("RoutePartID")
    public int getRoutePartID() {
        return RoutePartID;
    }

    public void setRoutePartID(int routePartID) {
        RoutePartID = routePartID;
    }

    @JsonProperty("RoutePartName")
    public String getRoutePartName() {
        return RoutePartName;
    }

    public void setRoutePartName(String routePartName) {
        RoutePartName = routePartName;
    }

    @JsonProperty("RoutePartCode")
    public String getRoutePartCode() {
        return RoutePartCode;
    }

    public void setRoutePartCode(String routePartCode) {
        RoutePartCode = routePartCode;
    }

    @JsonProperty("RoutePartPointID")
    public int getRoutePartPointID() {
        return RoutePartPointID;
    }

    public void setRoutePartPointID(int routePartPointID) {
        RoutePartPointID = routePartPointID;
    }

    @JsonProperty("RoutePartPointName")
    public String getRoutePartPointName() {
        return RoutePartPointName;
    }

    public void setRoutePartPointName(String routePartPointName) {
        RoutePartPointName = routePartPointName;
    }

    @JsonProperty("RoutePartPointCode")
    public String getRoutePartPointCode() {
        return RoutePartPointCode;
    }

    public void setRoutePartPointCode(String routePartPointCode) {
        RoutePartPointCode = routePartPointCode;
    }

    @JsonProperty("MaterialID")
    public int getMaterialID() {
        return MaterialID;
    }

    public void setMaterialID(int materialID) {
        MaterialID = materialID;
    }

    @JsonProperty("MaterialNo")
    public String getMaterialNo() {
        return MaterialNo;
    }

    public void setMaterialNo(String materialNo) {
        MaterialNo = materialNo;
    }

    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }

    @JsonProperty("MaterialNumber")
    public Double getMaterialNumber() {
        return MaterialNumber;
    }

    public void setMaterialNumber(Double materialNumber) {
        MaterialNumber = materialNumber;
    }

    @JsonProperty("TypeID")
    public int getTypeID() {
        return TypeID;
    }

    public void setTypeID(int typeID) {
        TypeID = typeID;
    }

    @JsonProperty("MaterialTypeID")
    public int getMaterialTypeID() {
        return MaterialTypeID;
    }

    public void setMaterialTypeID(int materialTypeID) {
        MaterialTypeID = materialTypeID;
    }

    @JsonProperty("MaterialTypeCode")
    public String getMaterialTypeCode() {
        return MaterialTypeCode;
    }

    public void setMaterialTypeCode(String materialTypeCode) {
        MaterialTypeCode = materialTypeCode;
    }

    @JsonProperty("MaterialTypeName")
    public String getMaterialTypeName() {
        return MaterialTypeName;
    }

    public void setMaterialTypeName(String materialTypeName) {
        MaterialTypeName = materialTypeName;
    }

    @JsonProperty("MaterialGroupID")
    public int getMaterialGroupID() {
        return MaterialGroupID;
    }

    public void setMaterialGroupID(int materialGroupID) {
        MaterialGroupID = materialGroupID;
    }

    @JsonProperty("MaterialGroupCode")
    public String getMaterialGroupCode() {
        return MaterialGroupCode;
    }

    public void setMaterialGroupCode(String materialGroupCode) {
        MaterialGroupCode = materialGroupCode;
    }

    @JsonProperty("MaterialGroupName")
    public String getMaterialGroupName() {
        return MaterialGroupName;
    }

    public void setMaterialGroupName(String materialGroupName) {
        MaterialGroupName = materialGroupName;
    }

    @JsonProperty("GradeID")
    public int getGradeID() {
        return GradeID;
    }

    public void setGradeID(int gradeID) {
        GradeID = gradeID;
    }

    @JsonProperty("UnitID")
    public int getUnitID() {
        return UnitID;
    }

    public void setUnitID(int unitID) {
        UnitID = unitID;
    }

    @JsonProperty("UnitText")
    public String getUnitText() {
        return UnitText;
    }

    public void setUnitText(String unitText) {
        UnitText = unitText;
    }

    @JsonProperty("UnitCode")
    public String getUnitCode() {
        return UnitCode;
    }

    public void setUnitCode(String unitCode) {
        UnitCode = unitCode;
    }

    @JsonProperty("ReplaceType")
    public int getReplaceType() {
        return ReplaceType;
    }

    public void setReplaceType(int replaceType) {
        ReplaceType = replaceType;
    }

    @JsonProperty("ReplaceRatio")
    public float getReplaceRatio() {
        return ReplaceRatio;
    }

    public void setReplaceRatio(float replaceRatio) {
        ReplaceRatio = replaceRatio;
    }

    @JsonProperty("OutsourceType")
    public int getOutsourceType() {
        return OutsourceType;
    }

    public void setOutsourceType(int outsourceType) {
        OutsourceType = outsourceType;
    }

    @JsonProperty("OriginalType")
    public int getOriginalType() {
        return OriginalType;
    }

    public void setOriginalType(int originalType) {
        OriginalType = originalType;
    }

    @JsonProperty("DisassyType")
    public int getDisassyType() {
        return DisassyType;
    }

    public void setDisassyType(int disassyType) {
        DisassyType = disassyType;
    }

    @JsonProperty("MaterialFullGroup")
    public String getMaterialFullGroup() {
        return MaterialFullGroup;
    }

    public void setMaterialFullGroup(String materialFullGroup) {
        MaterialFullGroup = materialFullGroup;
    }

    @JsonProperty("RoutePartPointOrder")
    public int getRoutePartPointOrder() {
        return RoutePartPointOrder;
    }

    public void setRoutePartPointOrder(int routePartPointOrder) {
        RoutePartPointOrder = routePartPointOrder;
    }

    @JsonProperty("Groes")
    public String getGroes() {
        return Groes;
    }

    public void setGroes(String groes) {
        Groes = groes;
    }

    @JsonProperty("RoutePartOrder")
    public int getRoutePartOrder() {
        return RoutePartOrder;
    }

    public void setRoutePartOrder(int routePartOrder) {
        RoutePartOrder = routePartOrder;
    }

    @JsonProperty("IsCodeScanning")
    public int getIsCodeScanning() {
        return IsCodeScanning;
    }

    public void setIsCodeScanning(int isCodeScanning) {
        IsCodeScanning = isCodeScanning;
    }

    @JsonProperty("IsCheck")
    public int getIsCheck() {
        return IsCheck;
    }

    public void setIsCheck(int isCheck) {
        IsCheck = isCheck;
    }
}
